package com.ftg.product.exam.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.diboot.core.mapper.BaseCrudMapper;
import com.ftg.product.exam.entity.SysEmployee;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
* 1.3 员工信息(名称、性别、所在部门、职务、邮箱、手机号、岗位)Mapper
* @author kangjx
* @version 1.0
* @date 2021-01-15
 * Copyright © ftg
*/
@Mapper
@Repository
public interface SysEmployeeMapper extends BaseCrudMapper<SysEmployee> {

    @Select("SELECT empname 员工姓名,b.item_name 性别,c.item_name 岗位,empphone 电话,empemail 电子邮箱," +
            "d.item_name 职务,e.orgname 所属部门,empphoto 照片,emppresent 自我介绍 " +
            "FROM sys_employee a LEFT JOIN dictionary b ON empsexcode = b.id " +
            "LEFT JOIN dictionary c ON emppostcode = c.id " +
            "LEFT JOIN dictionary d ON empjobcode = d.id " +
            "LEFT JOIN sys_organizations e ON emporgcode = e.id " +
            "where empphone = #{empphone} and emppassword = #{emppassword}")
    List<Map<String, Object>> login(String empphone, String emppassword);


    List<Map<String,Object>> query(String empname, Long emporgcode,Long empjobcode,Long emppostcode);
}

